local arrowHurtSkill = fk.CreateSkill {
  name = "arrowHurtSkill",
  tags = { Skill.Compulsory, },
}

arrowHurtSkill:addEffect(fk.TurnEnd, {
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(arrowHurtSkill.name) and target == player and player:getMark("@up_arrowhurt") > 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:setPlayerMark(player,"@up_arrowhurt",0)
    room:handleAddLoseSkills(player, "-arrowHurtSkill", nil, false)
    -- local mark = player:getMark("@up_arrowhurt")
    -- room:removePlayerMark(player,"@up_arrowhurt",1)
    -- if mark == 1 then
    --   room:handleAddLoseSkills(player, "-arrowHurtSkill", nil, false)
    -- end
  end,
})

arrowHurtSkill:addEffect("maxcards", {
  name = "#arrowhurtMaxMod",
  frequency = Skill.Compulsory,
  correct_func = function (self, player)
    if player:hasSkill(arrowHurtSkill.name) and player:getMark("@up_arrowhurt") > 0 then
      return -player:getMark("@up_arrowhurt")
    end
  end,
})


return arrowHurtSkill